using System;
using EPiServer.Common;
using EPiServer.Common.Security;
using EPiServer.Community.DirectMessage;
using EPiServer.Community.DirectMessage.Queries;

namespace EPiAbstractions.Community.DirectMessage
{
    public interface IDirectMessageHandlerFacade
    {
        MessageBase AddMessage(MessageBase message, FolderBase folder);

        MessageBase SendMessage(MessageBase message);

        MessageBase SendMessage(MessageBase message, FolderBase copyFolder);

        void UpdateMessage(MessageBase message);

        void RemoveMessage(MessageBase message);

        void RemoveMessage(MessageBase message, FolderBase folder);

        MessageBase GetMessage(Int32 id);

        MessageCollection GetMessages(FolderBase folder, Int32 page, Int32 pageSize, MessageSortOrder[] sortOrder);

        MessageCollection GetMessages(FolderBase folder, Int32 page, Int32 pageSize, out Int32 totalItems, MessageSortOrder[] sortOrder);

        void MoveMessage(MessageBase message, FolderBase fromFolder, FolderBase toFolder);

        FolderBase AddFolder(FolderBase folder);

        void UpdateFolder(FolderBase folder);

        void RemoveFolder(FolderBase folder);

        FolderBase GetFolder(Int32 id);

        FolderCollection GetFolders(DirectMessageContainer dmc);

        FolderCollection GetFolders(FolderBase parentFolder);

        SystemFolder GetSystemFolder(DirectMessageContainer container, SystemFolderType type);

        void UpdateRecipient(MessageRecipient recipient);

        void RemoveRecipient(MessageRecipient recipient);

        MessageRecipient GetRecipient(MessageBase message, IUser user);

        MessageRecipientCollection GetRecipients(MessageBase message);

        DirectMessageContainer AddDirectMessageContainer(DirectMessageContainer dmc);

        DirectMessageContainer GetDirectMessageContainer(Int32 id);

        DirectMessageContainer GetDirectMessageContainer(IUser user, ISite site);

        DirectMessageContainer GetDirectMessageContainer(IUser user, ISite site, Boolean createContainer);

        event EPiServerCommonEventHandler MessageSent;

        event EPiServerCommonEventHandler SystemMessageSent;

        MessageCollection GetQueryResult(MessageBaseQuery query);

        MessageCollection GetQueryResult(MessageBaseQuery query, Int32 page, Int32 pageSize);

        MessageCollection GetQueryResult(MessageBaseQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        FolderCollection GetQueryResult(FolderBaseQuery query);

        FolderCollection GetQueryResult(FolderBaseQuery query, Int32 page, Int32 pageSize);

        FolderCollection GetQueryResult(FolderBaseQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);
    }
}